package com.itheima.sevrice;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itheima.bean.Orders;
import com.itheima.bean.ShoppingCart;
import com.itheima.bean.User;
import com.itheima.common.PageParam;
import com.itheima.dto.OrdersDto;

import java.util.List;

public interface OrderService {

    /**
     * 添加订单
     * @param orders
     * @return
     */
    int add(Orders orders, User user);

    /**
     * 分页查询
     * @return
     */
    IPage<Orders> findPage(PageParam pageParam);

    /**
     * 修改订单的状态
     * @param orders
     * @return
     */
    int updateStatus(Orders orders);

    /**
     * 根据用户id 查询用户订单
     * @param pageParam
     * @return
     */
    IPage<OrdersDto> findUserPage(PageParam pageParam);

    /**
     * 再来一单
     * @param
     * @return
     */
    List<ShoppingCart> again(Long id);

}
